package at.fhhgb.mc.Aufgabe01;

/**
 * The class ListStack extends the class DoubleLinkedList.
 * It provides all methods to create a stack, based on a double-linked-list, and to work with it
 * @author Konrad
 *
 */
public class ListStack extends DoubleLinkedList {

	/**
	 * Constructor for the class. Sets head and tail to null
	 */
	public ListStack() {
		super();
	}

	/**
	 * Initializes the Stack with another stack
	 * @param other Other stack that will be copied
	 */
	public ListStack(ListStack other) {
		super(other);
	}

	/**
	 * Pushes a value onto the stack
	 * @param val Value that will be pushed
	 */
	public void push(int val) {
		super.pushFront(val);
	}

	/**
	 * Pops the front element of the stack
	 * @return Returns the front element of the stack
	 */
	public int pop() {
		return super.popFront();
	}

	/**
	 * Peeks the front element of the stack
	 * @return Returns the front element of the stack
	 */
	public int peek() {
		return super.peekFront();
	}
}
